import Cookies from 'js-cookie'

// 本地token
const TokenKey = 'HRSASS_TOKEN'

// 本地token时间戳
const TokenTime = 'TOKENTIME'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

// 存时间戳
export function setTokenTime() {
  Cookies.set(TokenTime, Date.now())
}

// 获取时间戳
export function getTokenTime() {
  return Cookies.get(TokenTime)
}

// 删除时间戳
export function deleteTokenTime() {
  return Cookies.remove(TokenTime)
}
